package com.djj.nanny.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("chat_message")
public class ChatMessage {
    @TableId(type = IdType.AUTO)
    private Long id;

    private Long sessionId;  // 聊天会话ID
    private Long senderId;   // 发送者ID
    private Long receiverId; // 接收者ID
    private String content;  // 消息内容
    private Integer readStatus; // 读取状态：0-未读，1-已读
    private Integer messageType; // 消息类型：1-文本，2-图片，3-系统消息

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableLogic
    private Integer isDeleted;
    
    // 非数据库字段
    @TableField(exist = false)
    private User sender;  // 发送者信息
    
    @TableField(exist = false)
    private User receiver;  // 接收者信息
} 